package model

import (
	"food-mgr/food-service/configs"
	"gorm.io/gorm"
)

type Slot struct {
	gorm.Model
	UserId int64  `gorm:"type:int(11);comment:用户ID"`
	BizId  int    `gorm:"type:int(11);comment:商家ID"`
	Year   string `gorm:"type:varchar(50);comment:预约人数"`
	Tel    string `gorm:"type:char(11);comment:联系方式"`
	Status string `gorm:"type:varchar(30);comment:预约状态"`
}

func CreateSlot(s *Slot) error {

	return configs.DB.Create(&s).Error
}
func ListSlot(s *[]Slot) error {

	return configs.DB.Order("year DESC").Find(&s).Error
}
func UpdateSlot(s *Slot, id int) error {

	return configs.DB.Where("id=?", id).Updates(&s).Error
}
